package com.ky.home.controller;


import com.ky.common.vo.R;
import com.ky.home.entity.Course;
import com.ky.home.mapper.CourseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @version 1.0
 * @Author 小胤
 * @Date 2024/6/17 15:00
 * @注释
 */
@RestController
@RequestMapping("/home")
public class CourseController {
    @Autowired
    private CourseMapper courseMapper;
    @RequestMapping("/getCourse")
    public R getCourse() {
        List<Course> courses = courseMapper.selectList(null);
        if (courses!=null){
            return R.ok(courses);
        }
        return R.fail("查询失败");
    }
}
